During runtime, class files are loaded into a memory device when an instance of a class is created. In particular, a first class file can be loaded into the memory device. Thereafter, if another class file calls the first class file but expects that the first class file is an updated version but is actually not an updated version, a software exception error can undesirably occur.
Versioning techniques available today mostly rely on development best practices to ensure backward compatibility. When developing a new version of a Java class, it is up to the developer to maintain backward compatibility, to make sure that class signatures match, to check whether modification of existent code may impact other applications relying on the current class version.
Prior art solutions are known for handling java class versioning. U.S. Pat. No. 7,207,002 discloses techniques for serializing objects (such as Java objects), and deserializing those objects, in a manner that enables contents of the objects to be preserved following changes to definitions of the object structures. Objects are serialized. The serialized objects thereby capture class definition information for the class definition which was in effect when the object was serialized. Subsequently, if the class definition is changed, it is possible to deserialize the information from the markup language document to an object that uses the new class definition, without requiring access to a programming language specification of the now-obsolete class definition.
US20060218538 discloses a method for converting an object. In one embodiment, information is obtained from an object that identifies a first version of code associated with the object.
Using the obtained information, a minimized class and converter class are identified for converting the object from a first format associated with the first version of code to a second format associated with a second version of the code. The minimized class is utilized to read the object in the first format and the converter class is utilized to convert the read object into the second format. The use of such a converter handles cases where an object needs to be transferred between two software applications of different versions.
These solutions both refer to the serialization of Java objects, when these objects are transferred from one Java runtime to a different one, using a different version of the object class. However, these solutions do not allow for handling java class versioning at a same runtime.